<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQuestionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('questions', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('question_category_id')->comment("试题类别ID");
            $table->string('name')->comment("名称");
            $table->text('stem')->comment("题干");
            $table->tinyInteger("question_type")->default(0)->comment("试题类型【单选|多选|判断|填空|简答】");
            $table->unsignedInteger('score')->comment("分数")->default(0);
            $table->unsignedInteger('users_id')->comment("创建人id");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('questions');
    }
}
